<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
	<script src="../vue.js"></script>
</head>
<body>

	<div id="app">
		<!-- <component :is="type"></component> -->
		<child-one v-if="type === 'child-one'"></child-one>
		<child-two v-if="type === 'child-two'"></child-two>
		<button @click="handleClick">change</button>
	</div>

	<script>

		Vue.component('child-one', {
			template: `<div v-once>this is one</div>`
		});

		Vue.component('child-two', {
			template: `<div v-once>this is two</div>`
		});

		var vm = new Vue({
			el: '#app',
			data: {
				type: 'child-one'
			},
			methods: {
				handleClick: function () {
					this.type = this.type === 'child-one' ? 'child-two' : 'child-one';
				}
			}
		});

	</script>
</body>
</html>